import request from "../../http";
const noticeApi = {
  async getNoticeData(query) {
    return request({
      url: "/api/notice",
      method: "get",
      params: query
    });
  },
  async queryNoticeData(query) {
    return request({
      url: "/api/notice",
      method: "get",
      params: query
    });
  },
  async getNoticeDetail(noticeId) {
    return request({
      url: `/api/notice/${noticeId}`,
      method: "get"
    });
  },
  async disableNotice(params) {
    return request({
      url: "/api/notice/disable",
      method: "put",
      data: params
    });
  },
  async postNoticeData(params) {
    return request({
      url: "/api/notice",
      method: "post",
      data: params
    });
  },
  async downloadNoticeFile(fileId) {
    return request({
      url: `/api/download3?id=${fileId}`,
      method: "get",
      responseType: "blob"
    });
  },
  async topNotice(params) {
    return request({
      url: "/api/notice/top",
      method: "put",
      data: params
    });
  }
};

export default noticeApi;
